com.rscja.team.qcom.r1.hf

## Class HF14443A

- java.lang.Object
- - com.rscja.team.qcom.r1.hf.HFBase
  - - com.rscja.team.qcom.r1.hf.HF14443A

- All Implemented Interfaces:
    IHF14443A

      public class HF14443A
      extends HFBase
      implements IHF14443A

- - ### Field Summary

    - ### Fields inherited from class com.rscja.team.qcom.r1.hf.HFBase

      `COMMAND_15693_SELECT, COMMAND_ACTIVATEIDLE, COMMAND_ANTICOLL, COMMAND_ANTICOLLINVENTORY, COMMAND_AUTHENTICATION, COMMAND_COS_COMMAND, COMMAND_DECREMENT, COMMAND_FM1216RESET, COMMAND_GET_MUL_BLOCK, COMMAND_GET_SYSTEM_INFO, COMMAND_HALT, COMMAND_HALT_TYPEB, COMMAND_INCREMENT, COMMAND_INITVAL, COMMAND_INVENTORY, COMMAND_LOCK_AFI, COMMAND_LOCK_BLOCK, COMMAND_LOCK_DSFID, COMMAND_READ, COMMAND_READ_SM, COMMAND_READVAL, COMMAND_REQUESTA, COMMAND_RESET_TO_READY, COMMAND_RESTORE, COMMAND_SELECT, COMMAND_TRANSFER, COMMAND_TRANSFERCOMMAND, COMMAND_TYPEARATS, COMMAND_TYPEAREST, COMMAND_TYPEB_GET_UID, COMMAND_TYPEBREST, COMMAND_ULANTICOLL, COMMAND_ULWRITE, COMMAND_WRITE, COMMAND_WRITE_AFI, COMMAND_WRITE_DSFID, COMMAND_WRITE_SM`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HF14443A(R1HFUSB usb)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `authentication(byte cMode, byte cBlock, byte[] pcKey)` 验证14443A卡(Authentication 14443A card)
    `byte[]` | `cpuCommand(byte[] cmd)` CPU卡发送命令(execute cpu card command)
    `byte[]` | `ratsTypeA()` CPU卡RATS操作指令(CPU card RATS operation command)
    `byte[]` | `readBlock(byte cBlock)` 读卡(Read card)
    `HF14443RequestEntity` | `requestTypeA()` 寻卡(Search card)
    `HF14443RequestEntity` | `requestTypeA(int mode)` 寻卡(Search card)
    `boolean` | `writeBlock(byte cBlock, byte[] pcBlockData)` 写卡(Write card)

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HF14443A

          public HF14443A(R1HFUSB usb)

  - ### Method Detail

    - #### requestTypeA

          public HF14443RequestEntity requestTypeA()

      寻卡(Search card)
      Specified by:
        `requestTypeA` in interface `IHF14443A`
      Returns:
        success will return HF14443RequestEntity data, failure will return null.

    - #### requestTypeA

          public HF14443RequestEntity requestTypeA(int mode)

      寻卡(Search card)
      Specified by:
        `requestTypeA` in interface `IHF14443A`
      Parameters:
        `mode` - 0x26:request idle; 0x52:request all
      Returns:
        success will return HF14443RequestEntity data, failure will return null.

    - #### authentication

          public boolean authentication(byte cMode,
                                        byte cBlock,
                                        byte[] pcKey)
                                 throws RFIDArgumentException

      验证14443A卡(Authentication 14443A card)
      Specified by:
        `authentication` in interface `IHF14443A`
      Parameters:
        `cMode` - 模式0x60:类型A,0x61类型B (0x60 A type key, 0x61 B type key)
        `cBlock` - 要写入的数据块S50 0-63,S70 0-255(the cBlock of card,such as S50 card value 0~63,S70 0~255)
        `pcKey` - 6个字节的密码(6 bytes key value)
      Returns:
        true:success false:fail RFIDArgumentException
      Throws:
        `RFIDArgumentException`

    - #### readBlock

          public byte[] readBlock(byte cBlock)

      读卡(Read card)
      Specified by:
        `readBlock` in interface `IHF14443A`
      Parameters:
        `cBlock` - 数据块0~63 (the cBlock of card,such as M1 card value 0~63 )
      Returns:
        success will return data, failure will return null.

    - #### writeBlock

          public boolean writeBlock(byte cBlock,
                                    byte[] pcBlockData)
                             throws RFIDArgumentException

      写卡(Write card)
      Specified by:
        `writeBlock` in interface `IHF14443A`
      Parameters:
        `cBlock` - 要写入的数据块S50 0-63,S70 0-255(the cBlock of card,such as S50 card value 0~63,S70 0~255)
        `pcBlockData` - 十六个字节的数据(16 bytes Block data)
      Returns:
        true:success false:fail
      Throws:
        `RFIDArgumentException`

    - #### ratsTypeA

          public byte[] ratsTypeA()

      CPU卡RATS操作指令(CPU card RATS operation command)
      Specified by:
        `ratsTypeA` in interface `IHF14443A`
      Returns:
        success will return data, failure will return null.

    - #### cpuCommand

          public byte[] cpuCommand(byte[] cmd)

      CPU卡发送命令(execute cpu card command)
      Specified by:
        `cpuCommand` in interface `IHF14443A`
      Parameters:
        `cmd` - 命令数据
      Returns:
        success will return data, failure will return null.